﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.IO;

namespace sfsocket.corelib.connection.client
{
    public class ChatClientState
    {
        //---------------------------------------------------------------------
        //  
        //---------------------------------------------------------------------
        private byte[] m_byteBuffer = null;
        private NetworkStream m_netStream = null;
        private int m_totalBytesRcvd = 0;

        //---------------------------------------------------------------------
        // fields 
        //---------------------------------------------------------------------
        public byte[] ByteBuffer
        {
            get { return m_byteBuffer; }
            set { m_byteBuffer = value; }
        }
        
        public NetworkStream NetStream
        {
            get { return m_netStream; }
        }
        
        public int TotalBytes
        {
            get { return m_totalBytesRcvd; }
        }

        //---------------------------------------------------------------------
        //  
        //---------------------------------------------------------------------
        public ChatClientState(NetworkStream netStream)
        {
            this.m_netStream = netStream;
        }

        public ChatClientState(NetworkStream netStream, byte[] byteBuffer)
        {
            this.m_netStream = netStream;
            this.m_byteBuffer = byteBuffer;
        }

        public void AddToTotalBytes(int count)
        {
            m_totalBytesRcvd += count;
        }
    }
}
